import i18n from '../../i18n/index'
export function getConfig() {
  return {
    formProps:{
      labelWidth:85
    },
    formCols:[
      {
        label:i18n.t('erp.transferName'),
        key:'stock_record_name',
        type:'easyinput',
        rules: [{ required: true, errorMessage: i18n.t('erp.transferName')+i18n.t('common.required')}],
        props:{
          placeholder: i18n.t('common.pleaseEnter') + i18n.t('erp.transferName') 
        }
      },
      {
        show:(params)=>{
          return [1,3,4,6].includes(params.recordType)
        },
        label:i18n.t('erp.outStore'),
        key:'out_store_id',
        // type:'data-select',
        type:'combox',
        rules: [{ required: true, errorMessage: i18n.t('erp.outStore')+i18n.t('common.required')}],
        props:{
          placeholder: i18n.t('common.pleaseChoose') + i18n.t('erp.outStore'),
          clear: true,
          localdata:[]
        }
      },
      {
        show:(params)=>{
          return [2,3,4].includes(params.recordType)
        },
        label: i18n.t('erp.enterStore'),
        key:'enter_store_id',
        // type:'data-select',
        type:'combox',
        rules: [{ required: true,errorMessage: i18n.t('erp.enterStore')+i18n.t('common.required')}],
        props:{
          placeholder: i18n.t('common.pleaseChoose') + i18n.t('erp.enterStore'),
          clear: true,
          localdata:[]
        }
      },
      {
        show:(params)=>{
          return ![6].includes(params.recordType)
        },
        label: i18n.t('erp.deliveryTime'),
        key:'allocate_send_date',
        type:'datetime-picker',
        rules: [{ required: true,errorMessage: i18n.t('erp.deliveryTime')+i18n.t('common.required')}],
        props:{
          placeholder: i18n.t('common.pleaseChoose') + i18n.t('erp.deliveryTime'),
          type:'date',//date/daterange/datetime/datetimerange
          returnType: 'string',// timestamp string date
          hideSecond:false
        }
      },
      {
        show:(params)=>{
          return [6].includes(params.recordType)
        },
        label: i18n.t('erp.invoiceTime'),
        key:'invoice_date',
        type:'datetime-picker',
        rules: [{ required: true, errorMessage: i18n.t('erp.invoiceTime')+i18n.t('common.required')}],
        props:{
          placeholder: i18n.t('common.pleaseChoose') + i18n.t('erp.invoiceTime'),
          type:'date',//date/daterange/datetime/datetimerange
          returnType: 'string',// timestamp string date
          hideSecond:false
        }
      },
      {
        label:i18n.t('common.remark'),
        key:'explain',
        type:'easyinput',
        props:{
          placeholder: i18n.t('common.pleaseEnter') + i18n.t('common.remark'),
          type:'textarea',
        }
      }
    ],
    apiName:{
      1:'adjustOut',
      2:'adjustEnter',
      3:'allocateOut',
      4:'allocateEnter',
      5:'',
      6:'saleOut'
    },
    itemCols:[
      {
        label:i18n.t('erp.transferName'),
        key:'stock_record_name'
      },
      {
        show:(params)=>{
          return [1,3,4,6].includes(params.recordType)
        },
        label:i18n.t('erp.outStore'),
        key:'out_store_name'
      },
      {
        show:(params)=>{
          return [2,3,4].includes(params.recordType)
        },
        label:i18n.t('erp.enterStore'),
        key:'enter_store_name'
      },
      {
        show:(params)=>{
          return ![6].includes(params.recordType)
        },
        label: i18n.t('erp.deliveryTime'),
        key:'allocate_send_date'
      },
      {
        show:(params)=>{
          return [6].includes(params.recordType)
        },
        label:i18n.t('erp.invoiceTime'),
        key:'allocate_send_date'
      },
      {
        label: i18n.t('common.remark'),
        key:'explain'
      },
      {
        label:i18n.t('erp.operator'),
        key:'operator'
      }
      
    ],
  } 
}